import { NumberChain } from '../dist/index';

(function DecimalChainTest() {
    const value1 = 0.123;
    const fmt1 = '3.4';
    const valueFmt1 = new NumberChain(value1).numberFmt(fmt1);
    console.log(`1==> 数值：${value1} 格式化参数：${fmt1} 格式化结果：${valueFmt1}`);
    const value2 = 95500.4;
    const fmt2 = '.4';
    const valueFmt2 = new NumberChain(value2).numberFmt(fmt2);
    console.log(`2==> 数值：${value2} 格式化参数：${fmt2} 格式化结果：${valueFmt2}`);
    const value3 = .123;
    const fmt3 = '4.4';
    const valueFmt3 = new NumberChain(value3).numberFmt(fmt3);
    console.log(`3==> 数值：${value3} 格式化参数：${fmt3} 格式化结果：${valueFmt3}`);
    const value = new NumberChain(100).numberAdd(0.1).numberSub(0.2).numberMul(300).numberDiv(5).numberFmt('.4');
    console.log(`4==> 计算结果：${value}`); // 5,994.0000
})();
